package main.java.design.builder;

/**
 * <p>
 *     实现Builder的接口以构造和装配该产品的各个部件，定义并明确它所创建的表示，并 提供一个检索产品的接口。
 * </p>
 *
 * @author : wangdejian
 * @version 1.0
 * @date : 2020/6/11 22:04
 */
public class ConcreteBuilder implements Builder {

    private Product product;

    public ConcreteBuilder(String name, String explain, String dateOfManufacture) {
        product = new Product(name, explain, dateOfManufacture);
    }

    @Override
    public void setAddress() {
        product.setAddress("产品生产地址");
    }

    @Override
    public void setPhone() {
        product.setPhone("产品联系电话");
    }

    @Override
    public Product getProduct() {
        return product;
    }
}
